#ifndef GADU_H
#define GADU_H

#include <libgadu.h>
#include <winsock.h>

enum state_gg_t{
    STATE_GG_CONNECTED = 0,
    STATE_GG_NOT_CONNECTED,
    STATE_GG_FAIL
};

typedef struct{
    int number;
    const char* pass;
    int state;
    const char* descr;
    state_gg_t status;
}Login;

class Gadu{
    public:
        Gadu(int, const char*, int state =  GG_STATUS_AVAIL, const char* descr = "");
        ~Gadu();

        state_gg_t login();
        state_gg_t logout();
        void sendMessage(int, const char*);
        state_gg_t getSessionStatus(){ return info.status; };
        int getEvents(){ return events->type; };
        void initEvents(){ events = gg_watch_fd(sess); };
        void cleanupEvents(){ gg_event_free(events); };
        void getMessage(int*, const char**, time_t*);
        void maintainConnection();
        void sendPing(){ gg_ping(sess); };

    private:
        Login info;
        struct gg_session* sess;
        struct gg_event* events;
};

#endif
